package animal;

import java.util.ArrayList;
import java.util.Collection;

public class AnimalExample {

	public static void main(String[] args) {
		Collection<Animal> animals = new ArrayList<Animal>();
		animals.add(new Dog("Spot"));
		animals.add(new Cat("Mittens"));
		animals.add(new Dog("Fido"));
		animals.add(new Bird("Twitter"));
		
		for(Animal animal : animals) {
			System.out.println(animal.getName() + " says " + animal.talk());
		}
	}
}
